const http = require("http");
const querystring = require("querystring");

http.createServer(function (req,res) {
	var GET = {};

	if(req.url.indexOf("?")!=-1){
		var arr = req.url.split("?");
		var url = arr[0];
		//arr[0]=>地址"/aaa"
		//arr[1]=>数据"username=adrain&password-123456"
		GET = querystring.parse(arr[1]);
	}else {
		var url = req.url;
	}


	console.log(url,GET);
	res.write("aaa");
	res.end();
}).listen(8080);